package test2;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;

import java.sql.Connection;
import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

@RunWith(Parameterized.class)
public class BookTest {
	private static Book book = new Book();
	private int year;
	private int month;
	private int day;
	private int num;
	
	public BookTest(int year, int month, int day, int num) {
		this.year = year;
		this.month = month;
		this.day = day;
		this.num = num;
	}
	
	@Parameters
	public static Collection<?> data(){
		return Arrays.asList(new Object[][] {
			{2008, 3, 8, 67},{2007, 3, 8, 68},{2004, 8, 8, 220}
		});
	}
	
	@Test
	public void test() {
		int nums = book.func(year, month, day);
		System.out.println(nums);
		assertEquals(nums, num);
	}
}